<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<NerdDinner.Web.Helpers.PaginatedList<NerdDinner.Web.Models.Data.Dinner>>" %>

<asp:Content ID="Content4" ContentPlaceHolderID="TitleContent" runat="server">
	<%= ViewData["PageTitle"] %>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="JavascriptContent" runat="server">
</asp:Content>

<asp:Content ID="Content5" ContentPlaceHolderID="MainContent" runat="server">

    <h2><%= ViewData["PageTitle"] %></h2>

    <ul> 
        <% foreach (var dinner in Model) { %> 
            <li> 
            <%= Html.ActionLink(dinner.Title, "Details", new { number=dinner.DinnerId }) %>             
            on  
            <%=Html.Encode(dinner.EventDate.ToShortDateString())%> 
            @ 
            <%=Html.Encode(dinner.EventDate.ToShortTimeString())%>. 
            Hosted by: 
            <%=Html.Encode(dinner.HostedBy)%> 
            at the following location 
            <i><%=Html.Encode(dinner.Address)%>, <%=Html.Encode(dinner.Country)%>  </i>
            </li> 
        <% } %> 
    </ul> 
    
    <% if (Model.HasPreviousPage) { %> 
        <%= Html.RouteLink("Previous", "Paged", new { controller = "Dinners", action = "Paged", page = (((Model.PageIndex - 1) == 0) ? string.Empty : ((Model.PageIndex - 1).ToString())) })%> 
    <% } %> 
 
    <% if (Model.HasNextPage) {  %> 
        <%= Html.RouteLink("Next", "Paged", new { controller = "Dinners", action = "Paged", page = (Model.PageIndex + 1) })%> 
    <% } %>   
    
   
</asp:Content>